
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module src.server</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="src.html"><font color="#ffffff">src</font></a>.server</strong></big></big> (4 August 2008)</font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/Users/yhuang/pdb2pqr/trunk/pdb2pqr/src/server.py">/Users/yhuang/pdb2pqr/trunk/pdb2pqr/src/server.py</a></font></td></tr></table>
    <p><tt>CGI&nbsp;Server&nbsp;for&nbsp;PDB2PQR<br>
&nbsp;<br>
This&nbsp;module&nbsp;contains&nbsp;the&nbsp;various&nbsp;functions&nbsp;necessary&nbsp;to&nbsp;run&nbsp;PDB2PQR<br>
from&nbsp;a&nbsp;web&nbsp;server.<br>
&nbsp;<br>
----------------------------<br>
&nbsp;<br>
PDB2PQR&nbsp;--&nbsp;An&nbsp;automated&nbsp;pipeline&nbsp;for&nbsp;the&nbsp;setup,&nbsp;execution,&nbsp;and&nbsp;analysis&nbsp;of<br>
Poisson-Boltzmann&nbsp;electrostatics&nbsp;calculations<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Copyright&nbsp;(c)&nbsp;2002-2010,&nbsp;Jens&nbsp;Erik&nbsp;Nielsen,&nbsp;University&nbsp;College&nbsp;Dublin;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Nathan&nbsp;A.&nbsp;Baker,&nbsp;Washington&nbsp;University&nbsp;in&nbsp;St.&nbsp;Louis;&nbsp;Paul&nbsp;Czodrowski&nbsp;&amp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Gerhard&nbsp;Klebe,&nbsp;University&nbsp;of&nbsp;Marburg<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;All&nbsp;rights&nbsp;reserved.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Redistribution&nbsp;and&nbsp;use&nbsp;in&nbsp;source&nbsp;and&nbsp;binary&nbsp;forms,&nbsp;with&nbsp;or&nbsp;without&nbsp;modification,&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;are&nbsp;permitted&nbsp;provided&nbsp;that&nbsp;the&nbsp;following&nbsp;conditions&nbsp;are&nbsp;met:<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Redistributions&nbsp;of&nbsp;source&nbsp;code&nbsp;must&nbsp;retain&nbsp;the&nbsp;above&nbsp;copyright&nbsp;notice,&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this&nbsp;list&nbsp;of&nbsp;conditions&nbsp;and&nbsp;the&nbsp;following&nbsp;disclaimer.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Redistributions&nbsp;in&nbsp;binary&nbsp;form&nbsp;must&nbsp;reproduce&nbsp;the&nbsp;above&nbsp;copyright&nbsp;notice,&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this&nbsp;list&nbsp;of&nbsp;conditions&nbsp;and&nbsp;the&nbsp;following&nbsp;disclaimer&nbsp;in&nbsp;the&nbsp;documentation&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and/or&nbsp;other&nbsp;materials&nbsp;provided&nbsp;with&nbsp;the&nbsp;distribution.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Neither&nbsp;the&nbsp;names&nbsp;of&nbsp;University&nbsp;College&nbsp;Dublin,&nbsp;Washington&nbsp;University&nbsp;in&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;St.&nbsp;Louis,&nbsp;or&nbsp;University&nbsp;of&nbsp;Marburg&nbsp;nor&nbsp;the&nbsp;names&nbsp;of&nbsp;its&nbsp;contributors&nbsp;may&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;be&nbsp;used&nbsp;to&nbsp;endorse&nbsp;or&nbsp;promote&nbsp;products&nbsp;derived&nbsp;from&nbsp;this&nbsp;software&nbsp;without&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;specific&nbsp;prior&nbsp;written&nbsp;permission.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;THIS&nbsp;SOFTWARE&nbsp;IS&nbsp;PROVIDED&nbsp;BY&nbsp;THE&nbsp;COPYRIGHT&nbsp;HOLDERS&nbsp;AND&nbsp;CONTRIBUTORS&nbsp;"AS&nbsp;IS"&nbsp;AND&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;ANY&nbsp;EXPRESS&nbsp;OR&nbsp;IMPLIED&nbsp;WARRANTIES,&nbsp;INCLUDING,&nbsp;BUT&nbsp;NOT&nbsp;LIMITED&nbsp;TO,&nbsp;THE&nbsp;IMPLIED&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;WARRANTIES&nbsp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VEN&nbsp;IF&nbsp;ADVISED&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;OF&nbsp;THE&nbsp;POSSIBILITY&nbsp;OF&nbsp;SUCH&nbsp;DAMAGE.<br>
&nbsp;<br>
----------------------------</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="os.html">os</a><br>
</td><td width="25%" valign=top><a href="string.html">string</a><br>
</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
</td><td width="25%" valign=top><a href="time.html">time</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-cleanTmpdir"><strong>cleanTmpdir</strong></a>()</dt><dd><tt>Clean&nbsp;up&nbsp;the&nbsp;temp&nbsp;directory&nbsp;for&nbsp;CGI.&nbsp;&nbsp;If&nbsp;the&nbsp;size&nbsp;of&nbsp;the&nbsp;directory<br>
is&nbsp;greater&nbsp;than&nbsp;LIMIT,&nbsp;delete&nbsp;the&nbsp;older&nbsp;half&nbsp;of&nbsp;the&nbsp;files.&nbsp;&nbsp;Since<br>
the&nbsp;files&nbsp;are&nbsp;stored&nbsp;by&nbsp;system&nbsp;time&nbsp;of&nbsp;creation,&nbsp;this&nbsp;is&nbsp;an<br>
easier&nbsp;task.</tt></dd></dl>
 <dl><dt><a name="-createError"><strong>createError</strong></a>(name, details)</dt><dd><tt>Create&nbsp;an&nbsp;error&nbsp;results&nbsp;page&nbsp;for&nbsp;CGI-based&nbsp;runs<br>
&nbsp;<br>
Parameters<br>
&nbsp;&nbsp;&nbsp;&nbsp;name:&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;result&nbsp;file&nbsp;root&nbsp;name,&nbsp;based&nbsp;on&nbsp;local&nbsp;time&nbsp;(string)<br>
&nbsp;&nbsp;&nbsp;&nbsp;details:&nbsp;The&nbsp;details&nbsp;of&nbsp;the&nbsp;error&nbsp;(string)</tt></dd></dl>
 <dl><dt><a name="-createResults"><strong>createResults</strong></a>(header, input, name, time, missedligands<font color="#909090">=[]</font>)</dt><dd><tt>Create&nbsp;the&nbsp;results&nbsp;web&nbsp;page&nbsp;for&nbsp;CGI-based&nbsp;runs<br>
&nbsp;<br>
Parameters<br>
&nbsp;&nbsp;&nbsp;&nbsp;header:&nbsp;The&nbsp;header&nbsp;of&nbsp;the&nbsp;PQR&nbsp;file&nbsp;(string)<br>
&nbsp;&nbsp;&nbsp;&nbsp;input:&nbsp;&nbsp;&nbsp;A&nbsp;flag&nbsp;whether&nbsp;an&nbsp;input&nbsp;file&nbsp;has&nbsp;been&nbsp;created&nbsp;(int)<br>
&nbsp;&nbsp;&nbsp;&nbsp;tmpdir:&nbsp;&nbsp;The&nbsp;resulting&nbsp;file&nbsp;directory&nbsp;(string)<br>
&nbsp;&nbsp;&nbsp;&nbsp;name:&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;result&nbsp;file&nbsp;root&nbsp;name,&nbsp;based&nbsp;on&nbsp;local&nbsp;time&nbsp;(string)<br>
&nbsp;&nbsp;&nbsp;&nbsp;time:&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;time&nbsp;taken&nbsp;to&nbsp;run&nbsp;the&nbsp;script&nbsp;(float)<br>
&nbsp;&nbsp;&nbsp;&nbsp;missedligands:&nbsp;A&nbsp;list&nbsp;of&nbsp;ligand&nbsp;names&nbsp;whose&nbsp;parameters&nbsp;could<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;not&nbsp;be&nbsp;assigned.&nbsp;Optional.&nbsp;(list)</tt></dd></dl>
 <dl><dt><a name="-logRun"><strong>logRun</strong></a>(options, nettime, size, ff, ip)</dt><dd><tt>Log&nbsp;the&nbsp;CGI&nbsp;run&nbsp;for&nbsp;data&nbsp;analysis.&nbsp;&nbsp;Log&nbsp;file&nbsp;format&nbsp;is&nbsp;as&nbsp;follows:<br>
&nbsp;<br>
DATE&nbsp;&nbsp;FF&nbsp;&nbsp;SIZE&nbsp;&nbsp;OPTIONS&nbsp;&nbsp;&nbsp;TIME<br>
&nbsp;<br>
Parameters<br>
&nbsp;&nbsp;&nbsp;&nbsp;options:&nbsp;The&nbsp;options&nbsp;used&nbsp;for&nbsp;this&nbsp;run&nbsp;(dict)<br>
&nbsp;&nbsp;&nbsp;&nbsp;nettime:&nbsp;The&nbsp;total&nbsp;time&nbsp;taken&nbsp;for&nbsp;the&nbsp;run&nbsp;(float)<br>
&nbsp;&nbsp;&nbsp;&nbsp;size:&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;final&nbsp;number&nbsp;of&nbsp;non-HETATM&nbsp;atoms&nbsp;in&nbsp;the&nbsp;PDB&nbsp;file&nbsp;(int)<br>
&nbsp;&nbsp;&nbsp;&nbsp;ff:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;name&nbsp;of&nbsp;the&nbsp;ff&nbsp;used<br>
&nbsp;&nbsp;&nbsp;&nbsp;ip:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;ip&nbsp;address&nbsp;of&nbsp;the&nbsp;user</tt></dd></dl>
 <dl><dt><a name="-setID"><strong>setID</strong></a>(time)</dt><dd><tt>Given&nbsp;a&nbsp;floating&nbsp;point&nbsp;time.time(),&nbsp;generate&nbsp;an&nbsp;ID.<br>
Use&nbsp;the&nbsp;tenths&nbsp;of&nbsp;a&nbsp;second&nbsp;to&nbsp;differentiate.<br>
&nbsp;<br>
Parameters<br>
&nbsp;&nbsp;&nbsp;&nbsp;time:&nbsp;&nbsp;The&nbsp;current&nbsp;time.time()&nbsp;(float)<br>
Returns<br>
&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;&nbsp;:&nbsp;&nbsp;The&nbsp;file&nbsp;id&nbsp;(string)</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>APBS_OPAL_URL</strong> = ''<br>
<strong>HAVE_APBS</strong> = ''<br>
<strong>HAVE_PDB2PQR_OPAL</strong> = '0'<br>
<strong>INSTALLDIR</strong> = '/Users/yhuang/pdb2pqr/'<br>
<strong>LIMIT</strong> = 500.0<br>
<strong>LOADPATH</strong> = '/proc/loadavg'<br>
<strong>LOGPATH</strong> = '/Users/yhuang/pdb2pqr//tmp//usage.txt'<br>
<strong>MAXATOMS</strong> = '10000'<br>
<strong>PACKAGE_PATH</strong> = ''<br>
<strong>PDB2PQR_OPAL_URL</strong> = ''<br>
<strong>REFRESHTIME</strong> = 20<br>
<strong>SRCPATH</strong> = '/Users/yhuang/pdb2pqr/trunk/pdb2pqr/'<br>
<strong>STYLESHEET</strong> = 'http://pitaya.wustl.edu/pdb2pqr/pdb2pqr.css'<br>
<strong>TMPDIR</strong> = 'tmp/'<br>
<strong>WEBNAME</strong> = 'index.html'<br>
<strong>WEBSITE</strong> = 'http://pitaya.wustl.edu/pdb2pqr/'<br>
<strong>__author__</strong> = 'Todd Dolinsky, Samir Unni, Yong Huang'<br>
<strong>__date__</strong> = '4 August 2008'</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Todd&nbsp;Dolinsky,&nbsp;Samir&nbsp;Unni,&nbsp;Yong&nbsp;Huang</td></tr></table>
</body></html>
